<template>
	<view class="goods" @tap="openShop"><image src="/static/goods.jpg" mode="widthFix"></image></view>
</template>

<script>
export default {
	name: 'goods',
	data() {
		return {
			goodsPath: ''
		};
	},
	created() {
		this.getConfiggoods();
	},
	methods: {
		getConfiggoods() {
			let code = 'wxcourse';
			this.$getajax(this.$api.getkfInfo, { code }).then(da => {
				if (da.code == 200) {
					this.goodsPath = da.data.name;
				}
			});
		},
		openShop() {
			if (!this.goodsPath) {
				return false;
			}
			wx.navigateToMiniProgram({
				appId: 'wx6865da7c4284b31e',
				path: this.goodsPath
			});
		}
	}
};
</script>

<style scoped lang="less">
	.goods{
		display: block;
		image{
			display: block;
			width: 100%;
		}
	}
</style>
